import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const getList = () => {
  return request({
    url: baseUrl + '/api/task/getpages',
    method: 'get'
  })
}

export const getlogpages = (page, limit, params) => {
  return request({
    url: baseUrl + '/api/task/getlogpages',
    method: 'get',
    params: {
      key:params.jobName==undefined?'':params.jobName,
      page,
      limit,
    }
  })
}
export const addJob = (row) => {
  return request({
    url: baseUrl + '/api/task/addJob',
    method: 'post',
    data: row
  })
}
export const stopJob = (row) => {
  return request({
    url: baseUrl + '/api/task/stopJob',
    method: 'post',
    data: row
  })
}

export const resumeJob = (row) => {
  return request({
    url: baseUrl + '/api/task/resumeJob',
    method: 'post',
    data: row
  })
}

export const removeJob = (row) => {
  return request({
    url: baseUrl + '/api/task/removeJob',
    method: 'post',
    data: row
  })
}

export const queryJob = (row) => {
  return request({
    url: baseUrl + '/api/task/queryJob',
    method: 'post',
    data: row
  })
}

export const modifyJob = (row) => {
  return request({
    url: baseUrl + '/api/task/modifyJob',
    method: 'post',
    data: row
  })
}

export const triggerJob = (row) => {
  return request({
    url: baseUrl + '/api/task/triggerJob',
    method: 'post',
    data: row
  })
}

export const startSchedule = () => {
  return request({
    url: baseUrl + '/api/task/startSchedule',
    method: 'post'
  })
}

export const stopSchedule = () => {
  return request({
    url: baseUrl + '/api/task/startSchedule',
    method: 'post'
  })
}

export const allJob = () => {
  return request({
    url: baseUrl + '/api/task/allJob',
    method: 'post'
  })
}

export const allJobBriefInfo = () => {
  return request({
    url: baseUrl + '/api/task/allJobBriefInfo',
    method: 'post'
  })
}

export const jobLogs = () => {
  return request({
    url: baseUrl + '/api/task/jobLogs',
    method: 'post'
  })
}
